﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using G.Navigate;

namespace FY13.View
{
    public partial class ContactsPage : GBasePage
    {
        public ContactsPage()
        {
            InitializeComponent();
        }

        private void btnBack_Click(object sender, EventArgs e)
        {
            this.GoBack();
        }

        private void btnMy_Click(object sender, EventArgs e)
        {
            GloabalData.GoUserInfo();
        }

        private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
           
            ListBox list = sender as ListBox;
            if (list.SelectedItem != null)
            {
                if (MessageBox.Show("Mack a Call?", "", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                {
                    Data.Contact c = list.SelectedItem as Data.Contact;
                    Microsoft.Phone.Tasks.PhoneCallTask p = new Microsoft.Phone.Tasks.PhoneCallTask();
                    p.DisplayName = c.Name;
                    p.PhoneNumber = c.Phone;
                    p.Show();
                }

            }
            list.SelectedItem = null;
        }
    }
}